// pages/my/pickUp-center/pickUp-center.js
const request = require('../../../../../utils/request')
Page({

    /**
     * 页面的初始数据
     */
    data: {
        baseUrl:request.BASE_URL,

        list: [],
        orderStauts: false, //订单状态
        currentInfo: {}, //当前点击订单
        codeImg: '', //取货码
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        this.getInfo()
    },
    getInfo() {
        let _this = this
        request._post('/api?method=merchants.pickGoods', {}).then(res => {
            this.setData({
                orderStauts: res.data.status,
                list: res.data.list,
                currentInfo: res.data.list[0] //默认第0条
            })
        })
    },
    /**
     * 上传照片
     */
    clickimg(e) {
        let item = e.currentTarget.dataset.item
        this.setData({
            currentInfo: item,
            codeImg: false,
        })
    },
    // 去首页
    goToFir() {
        wx.switchTab({
            url: '/pages/index/index',
        })
    },
    // 生成二维码
    getQuHuoMA() {
        this.setData({
            codeImg: true,
        })
    }
})